#include <iostream>
#include <vector>
#include <ctime>
using namespace std;

const double timeLimit = 8;

double GetTime() {
    return (double)clock() / CLOCKS_PER_SEC;
}

struct Point {
    int x, y;
    Point(int xx = 0, int yy = 0) {
        x = xx;
        y = yy;
    }

    Point operator - (Point op) {
        return Point(x - op.x, y - op.y);
    }

    int operator % (Point op) {
        return x * op.y - y * op.x;
    }
};

int sign(int x) {
    return x < 0 ? -1 : x > 0 ? 1 : 0;
}

class Planarity
{
private:
    vector<int> generateResult(int V, vector<int> &edges) {
        vector<int> result(2 * V);
        for (int i = 0; i < V; ++i) {
            int x = rand() % 700;
            int y = rand() % 700;
            result[2 * i] = x;
            result[2 * i + 1] = y;
        }
        return result;
    }

    bool intersect(vector<int> &coords, int is1, int ie1, int is2, int ie2) {

        Point s1(coords[is1 * 2], coords[is1 * 2 + 1]);
        Point e1(coords[ie1 * 2], coords[ie1 * 2 + 1]);
        Point s2(coords[is2 * 2], coords[is2 * 2 + 1]);
        Point e2(coords[ie2 * 2], coords[ie2 * 2 + 1]);

        if (max(s1.x, e1.x) < min(s2.x, e2.x)) return false;
        if (max(s2.x, e2.x) < min(s1.x, e1.x)) return false;
        if (max(s1.y, e1.y) < min(s2.y, e2.y)) return false;
        if (max(s2.y, e2.y) < min(s1.y, e1.y)) return false;

        int sign1 = sign((s2 - s1) % (e1 - s1)) * sign((e1 - s1) % (e2 - s1));
        int sign2 = sign((s1 - s2) % (e2 - s2)) * sign((e2 - s2) % (e1 - s2));

        if (sign1 < 0 || sign2 < 0) return false;
        if (sign1 == 0 && sign2 == 0) return false;

        return true;
    }

    int countIntersections(int V, vector<int> &edges, vector<int> &coords) {
        int res = 0;
        for (int i = 0; i < edges.size(); i += 2) {
            int u1 = edges[i];
            int v1 = edges[i + 1];

            for (int j = i + 2; j < edges.size(); j += 2) {
                int u2 = edges[j];
                int v2 = edges[j + 1];

                res += intersect(coords, u1, v1, u2, v2);
            }
        }
        return res;
    }

public:
    vector <int> untangle(int V, vector <int> edges) {
        vector<int> result;
        int bestIntersectionCount = edges.size() * edges.size();
        int stepsCounter = 0;
        while (GetTime() <= timeLimit) {
//            for (int iter = 0; iter < 10; ++iter) {
                ++stepsCounter;
                vector<int> localResult = generateResult(V, edges);

				int intersectionCount = edges.size() * edges.size(); 

                for (int i = 0; i < V; ++i) {
					int u = rand() % V;
					int v = rand() % V;
					swap(localResult[2 * u], localResult[2 * v]);
					swap(localResult[2 * u + 1], localResult[2 * v + 1]);

					int newIntersectionCount = countIntersections(V, edges, localResult);
					if (newIntersectionCount >= intersectionCount) {
						swap(localResult[2 * u], localResult[2 * v]);
						swap(localResult[2 * u + 1], localResult[2 * v + 1]);
					}
					else {
						intersectionCount = newIntersectionCount;
					}
				}

				//countIntersections(V, edges, localResult);
                if (bestIntersectionCount > intersectionCount) {
                    bestIntersectionCount = intersectionCount;
                    result = localResult;
                }

//            }
        }
        cerr << "stepsCounter = " << stepsCounter << endl;
        cerr << "bestIntersectionCount = " << bestIntersectionCount << endl;
        return result;
    }
};

int main()
{
	int V;
	cin >> V;
    int N;
	cin >> N;
	vector<int> edges(N);
    for (int i = 0; i < N; ++i) {
        cin >> edges[i];
	}
	Planarity plan;
    vector<int> coords = plan.untangle(V, edges);
    for (int i = 0; i < coords.size(); ++i) {
        cout << coords[i] << endl;
	}
	return 0;
}